package com.novel.download;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

@SpringBootApplication
public class DownloadApplication {

	public static void main(String[] args) throws UnknownHostException {
		ConfigurableApplicationContext application = SpringApplication.run(DownloadApplication.class, args);
		Environment env = application.getEnvironment();
		String ip = InetAddress.getLocalHost().getHostAddress();
		String port = env.getProperty("server.port");
//		String path = env.getProperty("server.servlet.context-path");
		System.out.println("\n-----------<------小说下载系统启动成功------>--------------\n\t" +
				"Local: \t\thttp://localhost:" + port  + "/novel\n\t" +
				"External: \thttp://" + ip + ":" + port + "/novel\n\t" +
				"----------------------------------------------------------");
	}

}
